package com.zxmc.server.controller.user;

import com.zxmc.common.result.Result;
import com.zxmc.pojo.entity.Author;
import com.zxmc.server.service.AuthorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user/author")
@Slf4j
@Api(tags = "作者相关接口")
public class AuthorController {

    @Autowired
    private AuthorService authorService;
    @GetMapping("/list")
    @ApiOperation("查询作者数据")
    public Result<List<Author>> list(Integer id) {
        log.info("查询作者数据");
        return Result.success(authorService.list(id));
    }

}
